/**
 * 
 */
package com.bsc.protracted.daos;

import java.io.Serializable;
import java.util.List;

/**
 * @author peike.ma
 * @see base dao infterface
 * 
 */
public interface BaseDao<T> {
    

    /**
     * get entity list for obj
     *
     * @param obj
     *            Hibernate bean
     * @param order
     *              order is true desc
     * @return bean list
     */
    public List<T> get(Class obj);

    public List<T> get(Class obj, boolean order);

    /**
     * get entity list for obj
     *
     * @param obj
     *            Hibernate bean
     * @param id
     * @return bean list
     */
    public Object get(Class obj, Serializable id);

    /**
     * get entity list where key = value
     * @param obj
     * @param key
     * @param vlaue
     * @param order order?
     * @param isEq is equals?
     * @return
     */
    public Object get(Class obj, String key, Object value, boolean isEq);

    public Object get(Class obj, String key, Object value, boolean order, boolean isEq);

    /**
     *
     * @param obj
     * @param first start id
     * @param max show number
     * @param order
     * @return
     */
    public Object get(Class obj, int first, int max);

    public Object get(Class obj, int first, int max, boolean order);

    public Object get(Class obj, String key, Object value, int first, int max, boolean order);

    /**
     *  get entity total
     * @param obj
     * @return
     */
    public int getTotalCount(final Class obj);

    /**
     * save entity
     *
     * @param obj
     *            save obj
     */
    public int save(Object obj);

    /**
     * updata entity
     *
     * @param obj
     *            updata obj
     */
    public void updata(Object obj);

    /**
     * delete entity
     *
     * @param obj
     *            delete obj
     */
    public void delete(Object obj);
    
    
    /**
     * get entity list for obj
     *
     * @param hql
     *            Hibernate bean
     * @return bean list
     */
    
    public List get(String hql);
    /**
     * save list
     *
     * @param list
     * save obj
     */
    public int save(List list);
    
}
